<template>
  <view>
    <u-navbar :title="$t('设置')"></u-navbar>
    <view class="box">
      <!-- #ifdef APP-PLUS || MP-WEIXIN || H5 -->
      <view class="list" @click="$.to('/pages/my/accountSettings')">
        <view>{{$t('账号设置')}}</view>
        <u-icon name="arrow-right"></u-icon>
      </view>
      <!-- #endif -->
      <view class="list" @click="$.to('/pages/my/about')">
        <view>{{$t('关于我们')}}</view>
        <u-icon name="arrow-right"></u-icon>
      </view>
      <view class="list" @click="$.to('/pagesA/pages/my/contact')">
        <view>{{$t('建议与反馈')}}</view>
        <u-icon name="arrow-right"></u-icon>
      </view>
      <!-- <view class="list">
				<view>日志上传</view>
				<u-icon name="arrow-right"></u-icon>
			</view> -->
      <view class="list">
        <view>{{$t('消息通知')}}</view>
        <view class="text">{{$t('已开启')}}</view>
      </view>

      <view class="btn" @click="logOut">{{$t('退出登录')}}</view>
    </view>
	
	
	
	<!-- 无用代码 -->
    <view v-if="false" class="wuxiaocode-t">
      <view class="wuxiaocode-t-user">
        <view class="wuxiaocode-t-user-pic"></view>
        <view class="wuxiaocode-t-user-right">
          <view class="wuxiaocode-t-user-right-name">张三</view>
          <view class="wuxiaocode-t-user-right-id">ID：121233222</view>
          <view class="wuxiaocode-t-user-right-tip">点击头像可编辑信息</view>
        </view>
      </view>
      <view class="myOrder">
        <view class="title n-flex-row n-justify-between">
          <view>我的订单</view>
        </view>
        <view class="orderList n-flex-row n-justify-between">
          <view class="list">
            <view>全部订单</view>
          </view>
          <view class="list" @click="handleJumpsPage">
            <u-badge type="error" :offset="0"></u-badge>
            <view>待发货</view>
          </view>
          <view class="list" @click="handleJumpsPage">
            <view>待收货</view>
          </view>
          <view class="list" @click="handleJumpsPage">
            <view>已完成</view>
          </view>
        </view>
      </view>
      <view class="serve-item">
        <view class="serve-item-text"></view>
      </view>
      <view class="serve-item">
        <view class="serve-item-text"></view>
      </view>
      <view class="serve-item">
        <view class="serve-item-text"></view>
      </view>
      <view class="serve-item">
        <view class="serve-item-text"></view>
      </view>
      <view class="serve-item">
        <view class="serve-item-text"></view>
      </view>
      <view class="serve-item">
        <view class="serve-item-text"></view>
      </view>
      <view class="serve-item">
        <view class="serve-item-text"></view>
      </view>
      <view class="serve-item">
        <view class="serve-item-text"></view>
      </view>
      <view class="serve-item">
        <view class="serve-item-text"></view>
      </view>
      <view class="serve-item">
        <view class="serve-item-text"></view>
      </view>
    </view>
  </view>
</template>

<script>
// #ifdef APP-PLUS
var qiyuModule = uni.requireNativePlugin("Netease-QiyuModule");
// #endif
export default {
	data() {
		return {};
	},
	onShow() {
		if (!uni.getStorageSync("user")) {
			uni.redirectTo({
				url:'../../../../pages/my/login'
			})
		}
	},
	methods: {
		testLogout() {
			qiyuModule.logout((ret) => {
				if (ret.success == true) {
					// modal.toast({
					// 	message: '成功',
					// 	duration: 1.5
					// });
				} else {
				  // modal.toast({
				  // 	message: '失败' + JSON.stringify(ret.errMsg),
				  // 	duration: 1.5
				  // });
				}
			});
		},
		// 退出登录
		logOut() {
			// // #ifdef APP-PLUS
			// this.testLogout();
			// // #endif
			uni.removeStorageSync("user");
			uni.removeStorageSync("user_token");
			uni.$emit("updataUser");
			uni.navigateTo({
				url: "/pages/my/login",
			});
		},
	},
};
</script>

<style>
page {
  background-color: #f4f4fc;
}

.box {
  padding: 0 20rpx;
  box-sizing: border-box;
}

.list {
  background-color: #fff;
  margin: 20rpx auto;
  padding: 34rpx 20rpx;
  box-sizing: border-box;
  border-radius: 10rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list .text {
  color: #999;
  font-size: 26rpx;
}

.btn {
  background-color: #fff;
  margin: 20rpx auto;
  padding: 30rpx 20rpx;
  box-sizing: border-box;
  border-radius: 10rpx;
  text-align: center;
  font-size: 32rpx;
}
</style>
